<!--
 * @Author: alenjzhang
 * @Date: 2024-03-20 22:39:49
 * @Description: 健康信息
-->
<script setup lang="ts">
import { INPUT_PLACEHOLDER, WHETHER_ENUM } from '@/const/index.ts';
import type { FormProps } from '@/types'
import { toRefs } from 'vue';

const props = defineProps<FormProps>()

const { readonly, formState } = toRefs(props);


</script>

<template>
	<a-form-item label="既往病史" class="thirtyPercentWidth">
		<a-input v-if="!readonly" :placeholder="INPUT_PLACEHOLDER"
			v-model:value="formState.pastMedicalHistory"></a-input>
		<span v-else>{{ formState.pastMedicalHistory }}</span>
	</a-form-item>
	<a-form-item label="手术史" class="thirtyPercentWidth">
		<a-input v-if="!readonly" :placeholder="INPUT_PLACEHOLDER"
			v-model:value="formState.surgicalHistory"></a-input>
		<span v-else>{{ formState.surgicalHistory }}</span>
	</a-form-item>
	<a-form-item label="药物过敏史" class="thirtyPercentWidth">
		<a-input v-if="!readonly" :placeholder="INPUT_PLACEHOLDER"
			v-model:value="formState.drugAllergyHistory"></a-input>
		<span v-else>{{ formState.drugAllergyHistory }}</span>
	</a-form-item>
	<a-form-item label="过敏原" class="thirtyPercentWidth">
		<a-input v-if="!readonly" :placeholder="INPUT_PLACEHOLDER" v-model:value="formState.allergen"></a-input>
		<span v-else>{{ formState.allergen }}</span>
	</a-form-item>
	<a-form-item label="饮食忌口" class="thirtyPercentWidth">
		<a-input v-if="!readonly" :placeholder="INPUT_PLACEHOLDER"
			v-model:value="formState.dietaryTaboos"></a-input>
		<span v-else>{{ formState.dietaryTaboos }}</span>
	</a-form-item>
	<a-form-item label="是否吸烟" class="thirtyPercentWidth">
		<a-radio-group v-if="!readonly" :options="WHETHER_ENUM.options"
			v-model:value="formState.smoke"></a-radio-group>
		<span v-else>{{ WHETHER_ENUM.map[formState.smoke || 0] }}</span>
	</a-form-item>
	<a-form-item label="是否饮酒" class="thirtyPercentWidth">
		<a-radio-group v-if="!readonly" :options="WHETHER_ENUM.options"
			v-model:value="formState.drink"></a-radio-group>
		<span v-else>{{ WHETHER_ENUM.map[formState.drink || 0] }}</span>
	</a-form-item>
</template>
